﻿using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace ST.Buz.Base.Entity
{
	[Serializable]
	[Table("Sys_UserAddress")]
	public partial class Sys_UserAddress
	{
		[Key]
		[Column("ID")]
		public int ID { get; set; }

		[Column("UserID")]
		public int UserID { get; set; }

		/// <summary>
		/// 地址类别
		/// </summary>
		[Column("Type")]
		public int Type { get; set; }

		/// <summary>
		/// 收货人姓名
		/// </summary>
		[Column("Name")]
		[StringLength(20, ErrorMessage = "{0}长度不能超过{1}")]
		public string Name { get; set; }

		/// <summary>
		/// 收货人电话
		/// </summary>
		[Column("Mobile")]
		[StringLength(15, ErrorMessage = "{0}长度不能超过{1}")]
		public string Mobile { get; set; }

		///// <summary>
		///// 收货人电话
		///// </summary>
		//[Column("Telephone")]
		//[StringLength(20, ErrorMessage = "{0}长度不能超过{1}")]
		//public string Telephone { get; set; }

		/// <summary>
		/// 省
		/// </summary>
		[Column("Province")]
		[StringLength(50, ErrorMessage = "{0}长度不能超过{1}")]
		public string Province { get; set; }

		/// <summary>
		/// 省代码
		/// </summary>
		[Column("ProvinceID")]
		[StringLength(32, ErrorMessage = "{0}长度不能超过{1}")]
		public string ProvinceID { get; set; }

		/// <summary>
		/// 市
		/// </summary>
		[Column("City")]
		[StringLength(50, ErrorMessage = "{0}长度不能超过{1}")]
		public string City { get; set; }

		/// <summary>
		/// 市代码
		/// </summary>
		[Column("CityID")]
		[StringLength(32, ErrorMessage = "{0}长度不能超过{1}")]
		public string CityID { get; set; }

		/// <summary>
		/// 区、县
		/// </summary>
		[Column("District")]
		[StringLength(50, ErrorMessage = "{0}长度不能超过{1}")]
		public string District { get; set; }

		/// <summary>
		/// 区、县代码
		/// </summary>
		[Column("DistrictID")]
		[StringLength(32, ErrorMessage = "{0}长度不能超过{1}")]
		public string DistrictID { get; set; }

		/// <summary>
		/// 乡镇、街道
		/// </summary>
		[Column("Town")]
		[StringLength(50, ErrorMessage = "{0}长度不能超过{1}")]
		public string Town { get; set; }

		/// <summary>
		/// 乡镇、街道代码
		/// </summary>
		[Column("TownID")]
		[StringLength(32, ErrorMessage = "{0}长度不能超过{1}")]
		public string TownID { get; set; }

		/// <summary>
		/// 详细地址
		/// </summary>
		[Column("DetailAddress")]
		[StringLength(100, ErrorMessage = "{0}长度不能超过{1}")]
		public string DetailAddress { get; set; }

		/// <summary>
		/// 邮编
		/// </summary>
		[Column("ZipCode")]
		[StringLength(6, ErrorMessage = "{0}长度不能超过{1}")]
		public string ZipCode { get; set; }

		/// <summary>
		/// 排序（值越小）
		/// </summary>
		[Column("Sort")]
		public int Sort { get; set; }

		/// <summary>
		/// 首选地址
		/// </summary>
		[Column("Preferred")]
		public bool Preferred { get; set; }

		/// <summary>
		/// 创建时间
		/// </summary>
		[Column("AddDate")]
		public DateTime AddDate { get; set; }

		/// <summary>
		/// 创建人ID
		/// </summary>
		[Column("AddManID")]
		[JsonIgnore]
		public int AddManID { get; set; }

		/// <summary>
		/// 创建人
		/// </summary>
		[Column("AddManName")]
		[StringLength(20, ErrorMessage = "{0}长度不能超过{1}")]
		public string AddManName { get; set; }

		/// <summary>
		/// 最后修改日期
		/// </summary>
		[Column("LastModifyDate")]
		public DateTime LastModifyDate { get; set; }

		/// <summary>
		/// 最后修改人ID
		/// </summary>
		[Column("LastModifyManID")]
		[JsonIgnore]
		public int LastModifyManID { get; set; }

		/// <summary>
		/// 最后修改人
		/// </summary>
		[Column("LastModifyManName")]
		[StringLength(20, ErrorMessage = "{0}长度不能超过{1}")]
		public string LastModifyManName { get; set; }
	}
}
